package com.guochenglang.www.util.connect;


import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * 连接池接口
 *
 * @author 郭程朗
 */
public interface Connectutil {


    /**
     * 获取连接实现
     *
     * @return Connection连接
     * @throws SQLException         sql异常
     * @throws InterruptedException 断点异常
     */
    Connection getConnection() throws InterruptedException, SQLException;

    /**
     * 归还连接
     *
     * @throws SQLException sql异常
     */
    void returnConnection() throws SQLException;

    /**
     * 释放连接
     */
    void releaseConnection();

    /**
     * 释放所有连接
     *
     * @param conn      Connection连接
     * @param state     Statement连接
     * @param resultSet Resultset连接
     */
    void releaseAll(Connection conn, Statement state, ResultSet resultSet);


}
